Repository navigation
add vuln-coreos-pam-permit check for CoreOS Alpha 104x PAM bypass - #54
Merged
Merged
Conversation
CoreOS Linux Alpha 1045.0.0 and 1047.0.0 ended the PAM auth stack with pam_permit after two sufficient modules, so any password opened a session for any account (CVE-2016-4455). The check runs by default against the exact banner those releases sent (SSH-2.0-OpenSSH_7.2), tries the scanned user and then the CoreOS core and operator accounts with a random password over keyboard-interactive and password auth, and reports only when a session opens and runs a command. Adds SessionUser to the auth result so interactive and session-stage checks reconnect as the account that actually authenticated. Includes in-process SSH server tests, a vulnerable Docker target built from the OpenSSH 7.2p2 source with PAM, a patched control, and docs.
…ln-coreos-pam-permit # Conflicts: # README.md # cmd/check_vuln.go # cmd/cmd_scan.go # docs/targets/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
vuln-coreos-pam-permit, a default-enabled check for CVE-2016-4455. CoreOS Linux Alpha 1045.0.0 and 1047.0.0 enabledpam_sssby marking it andpam_unixassufficientwhile keeping Gentoo's trailingauth optional pam_permit.so. When both modules failed, PAM fell through topam_permit, so any password opened a session for any account, including the password-lesscoreandoperatorusers.References:
How the check works
SSH-2.0-OpenSSH_7.2. CoreOS 1032 through 1053 shipped openssh-7.2_p2 from coreos-overlay, upstream sshd omits the portable suffix, and CoreOS set no addendum. Debian/Ubuntu (OpenSSH_7.2p2 ...), FreeBSD, and every other release are skipped without a connection.keyboard-interactiveorpasswordauth. CoreOS used Gentoo defaults (UsePAM yes,PasswordAuthentication no,ChallengeResponseAuthentication yes), so the bypass was reached over keyboard-interactive.coreandoperator, with a random password over keyboard-interactive and then password. Each attempt opens a session and runsid. A finding is recorded only when the command completes.-I first/-I alland the session-stage checks reconnect as that account.Plumbing
AuthResultgainsSessionUser(sessionUserin JSON).StartInteractandTestSessionswitch to that username when it differs from the scanned one.Tests and targets
core, the scanned user being tried first, password-only servers, no finding when every password is rejected, no connection for other banners, and reuse of the cached credential for interaction.docs/targets/coreos-pam-permit/has a vulnerable image (OpenSSH 7.2p2 built from the upstream tarball with PAM on Ubuntu 16.04, CoreOS 104x PAM stack) and a patched control (pam_deny, as in 1053.0.0), plus a README with setup and verification steps.Verified live: the default-user scan reports
corevia keyboard-interactive and the session checks and interactive mode reuse that session;-u operatorreports on the first attempt; the patched control runs the check on the 7.2 banner and reports nothing.Deviation noted in the docs
CoreOS listed
pam_sssin the account stack as[default=bad success=ok user_unknown=ignore]. With no sssd running, pam_sss returnsPAM_AUTHINFO_UNAVAILthere, whichdefault=badturns into a denial. The overlay sources do not explain how CoreOS logins got past that line, so both test images addauthinfo_unavail=ignoreto it. The two images then differ only inpam_permitversuspam_deny.Merge note
This branch and
vuln-musl-crypt-starboth adddocs/targets/README.mdand the same README checks line, so whichever merges second needs a small conflict resolution.